package com.ityueqiangu.system.controller;

import com.ityueqiangu.core.enums.CommonEnum;
import com.ityueqiangu.core.web.result.ResultDataUtil;
import com.ityueqiangu.core.web.result.ResultInfo;
import com.ityueqiangu.system.domain.SysUser;
import com.ityueqiangu.system.service.IWebSocketService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


/**
 * @author yanghc
 */
@Controller
@RequestMapping("/socket")
public class WebSocketController {
    @Autowired
    private IWebSocketService webSocketService;
    /**
     *@description:发送信息
     *@author:cyb
     *@date: 2018-11-19 10:03
     *@param: id
     *@return: java.util.Map<java.lang.String,java.lang.Object>
     */
    @RequestMapping("/send")
    @ResponseBody
    public ResultInfo sndmsg(Long id){
        SysUser user = new SysUser();
        try{
            int k = webSocketService.sndmsg(id,user);
        }catch (Exception e){

        }
        return ResultDataUtil.createSuccess(CommonEnum.SELECT_SUCCESS).setData(null);
    }
}
